package com.clear.honghefinance.biz.modules.system.member.enums;

import lombok.Getter;

/**
 * 短信类型
 */
@Getter
public enum SmsCodeTypeEnum {
    REGISTER("REGISTER", "注册"),
    LOGIN("LOGIN", "登录"),
    UPDATE_PHONE("UPDATE_PHONE", "修改手机号");

    private final String message;
    private final String code;

    SmsCodeTypeEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public static SmsCodeTypeEnum getByCode(String codeVal) {
        for (SmsCodeTypeEnum smsCodeTypeEnum : SmsCodeTypeEnum.values()) {
            if (smsCodeTypeEnum.code.equals(codeVal)) {
                return smsCodeTypeEnum;
            }
        }
        return null;
    }
}
